package demo;

import java.io.Console;
import java.util.Scanner;
//输入流
public class Input {
    public static void main(String[] args) {
        //Scanner类   标准输入流
//        Scanner sc = new Scanner(System.in);
//        System.out.println("请输入一行字符串");
//        //输入一行字符串
//        String str = sc.nextLine();
//        //以空格为分界的字符串
//        String str1 = sc.next();
//        System.out.println("str1: "+str1);
//        System.out.println("str:"+str );
//        System.out.println("请输入一个整数：");
//        //从控制台接收一个整数
//        int a = sc.nextInt();
//        System.out.println("a: "+a);
//        System.out.println("============================");

        //Console类  从控制台读取密码
        Console cons = System.console();
        String username = cons.readLine("User name: ");
        char[] passwd = cons.readPassword("Password: ");

    }
}
